/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rtsgame.core.view.graphics;

import java.awt.Color;
import java.awt.Graphics2D;
import java.util.Date;

/**
 *
 * @author tom
 */
public class MovePointer extends GraphicElement{

  private int x;
  private int y;
  private Color color = Color.RED;

  private long startTime;

  @Override
    public void Draw(Graphics2D graphic2D) {
        long timeElapse = new Date().getTime() - startTime;

        if (timeElapse < 100) {
            graphic2D.setColor(color);
            graphic2D.drawOval(x - 20, y - 15, 40, 30);
        } else if (timeElapse < 150) {
            graphic2D.setColor(color);
            graphic2D.drawOval(x - 10, y - 7, 20, 14);

        }

    }

  @Override
  public void DrawSelect(Graphics2D graphic2D) {
    return;
  }

  @Override
  public boolean isCollision(GraphicElement element) {
    return false;
  }

  private void startTime() {
     startTime = new Date().getTime();
  }

  @Override
  public void setX(int x) {
   this.x = x;
   startTime();
  }

  @Override
  public void setY(int y) {
    this.y = y;
   startTime();
  }

  @Override
  public int getX() {
   return x;
  }

  @Override
  public int getY() {
    return y;
  }

  @Override
  public boolean hit(int x, int y) {
    return false;
  }

}
